<template>
    <div class="content">
        <el-dialog :visible.sync="modifyMsg.dialogFormVisible" title="" size="tiny" :before-close="handleClose" > 
            <div v-loading = loading>
                <div class="title">更多信息</div>
                    <div class="table">
                        <table class="dialogTable" align="center">
                            <tr>
                                <td class="cl-text">e学云ID号</td>
                                <td>{{form.exueCode || '--'}}</td>
                                <td class="cl-text">用户名</td>
                                <td>{{form.userName || '--'}}</td>
                            </tr>
                            <tr>
                                <td class="cl-text">手机号</td>
                                <td class="cl-mony text-block">{{form.phone || '--'}}</td>
                                <td class="cl-text">所属区域</td>
                                <td><span v-if="form.provinceName">{{form.provinceName || '--'}}</span><span v-if="form.cityName">-{{form.cityName || '--'}}</span><span v-if="form.areaName">-{{form.areaName || '--'}}</span></td>
                            </tr>
                        </table>
                        <div class="mr"></div>
                        <table v-loading="tableloading" class="dialogTable" align="center" v-if="Object.is(tableData.status,'已驳回')">
                            <tr>
                                <td class="cl-text">结算结果</td>
                                <td class="text-block" colspan="3">{{tableData.status || '--'}}</td>
                                <!-- <td class="cl-text"></td>
                                <td></td> -->
                            </tr>
                            <tr>
                                <td class="cl-text">处理人</td>
                                <td class="text-block">{{tableData.checkor || '--'}}</td>
                                <td class="cl-text">处理时间</td>
                                <td class="text-block">{{tableData.time || '--'}}</td>
                            </tr>
                            <tr>
                                <td class="cl-text">原因</td>
                                <td class="text-block" colspan="3">{{tableData.reject || '--'}}</td>
                                <!-- <td class="cl-text cl-right"></td>
                                <td></td> -->
                            </tr>
                        </table>
                    </div>
                <div class="mr"></div>
                <footer>
                    <el-button @click="handleClose">关闭</el-button>
                </footer>
            </div>
        </el-dialog>
    </div>
</template>
<script>
import { getMoreInfomation, getCheckInfo } from 'api/mentionManagement';
export default {
    name: 'mentionMsg',
    props: {
        modifyMsg: {}
    },
    created() {
        this.seach();
    // this.seachTable()
    },
    data() {
        return {
            loading: false,
            tableloading: false,
            form: {},
            tableData: {}
        };
    },
    methods: {
        handleClose() {
            this.modifyMsg.dialogFormVisible = false;
        },
        seach() {
      
            let p = new Promise((resolve, reject) => {
                var userId = this.modifyMsg.userId;
            
                return resolve(userId);
            });
            p
        .then((userId) => {
            this.loading = true;
            getMoreInfomation(userId)
            .then(data => {
                this.loading = false;
                if (data.data.content) {
                    this.form = data.data.content;
                }
            })
            .catch(Error => {
                this.loading = false;
            });
        })
        .then(() => {
            if (this.modifyMsg.flag == 1 || this.modifyMsg.flag == 2) {
                this.tableloading = true;
                getCheckInfo(this.modifyMsg.flag, this.modifyMsg.pId)
              .then(data => {
                  this.tableloading = false;
                  this.tableData = data.data.content;
              })
              .catch(() => {
                  this.tableloading = false;
              });
            }
        });
        },
    // seach() {
    //   this.loading = true;
    //   getMoreInfomation(this.modifyMsg.userId)
    //     .then(data => {
    //       this.loading = false;
    //       if (data.data.content) {
    //         this.form = data.data.content;
    //       }
    //     })
    //     .catch(error => {
    //       this.loading = false;
    //     });
    // },
    // seachTable() {
    //   if (this.modifyMsg.flag == 1 || this.modifyMsg.flag == 2) {
    //     this.tableloading = true;
    //     getCheckInfo(this.modifyMsg.flag, this.modifyMsg.pId)
    //       .then(data => {
    //         this.tableloading = false;
    //         this.tableData = data.data.content;
    //       })
    //       .catch(() => {
    //         this.tableloading = false;
    //       });
    //   }
    // },
        add() {
            console.log('成功！');
      // this.$emit("sortInfor", value);
      // this.modifyMsg.dialogFormVisible = false;
        }
    }
};
</script>
<style lang="scss" scoped>
section,
footer {
  text-align: center;
}
.mr {
  margin-bottom: 30px;
}
.title {
  position: relative;
  margin-bottom: 30px;
  font-size: 14px;
  padding-left: 20px;
  &::after {
    content: "";
    position: absolute;
    left: 0;
    top: 2px;
    width: 4px;
    height: 14px;
    background: #ff5e2c;
  }
}
section {
  padding-bottom: 50px;
  el-button {
    margin-right: 20px;
  }
}
.cl-text {
  color: #000;
}
.dialogTable {
  text-align: center;
  //   margin: 30px auto;
  th,
  td {
    padding: 0 20px;
    text-align: center;
    border: solid 1px #ececec;
    height: 40px;
  }
  .cl-right {
    border-right: solid 1px transparent;
  }
  tr td:nth-of-type(1) {
    width: 130px;
  }
  tr td:nth-of-type(2) {
    width: 127px;
    text-align: left;
    // overflow: hidden; /*超出部分隐藏*/
    // white-space: nowrap; /*不换行*/
    // text-overflow: ellipsis; /*超出部分文字以...显示*/
  }
  tr td:nth-of-type(3) {
    width: 130px;
  }
  tr td:nth-of-type(4) {
    width: 210px;
  }
}
.cl-mony {
  color: #ff6600;
}
.text-block {
  color: #000;
}
</style>
